<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>
  </head>

  <body>
    <div id="app">
      {{msg}}
      <Foo>
        <template #two> </template>
      </Foo>

      <Foo v-slot="data">{{data.count}} --{{data}} </Foo>
    </div>
    <script>
      // 简写 v-slot -> #

      const Foo = {
        data() {
          return {
            count: 1,
            double: 2,
          };
        },
        template: `<div>Foo
          
          <div>
          <slot :count="count" :double="double"> 456</slot>
          </div>

          <div class="two">
            <slot name="two"></slot>
            </div>
          <div class="three">
            <slot name="three"></slot>
            </div>
          </div>`,
      };

      const app = new Vue({
        el: "#app",
        components: {
          Foo,
        },
        data: {
          msg: "hello ",
        },
      });
    </script>
  </body>
</html>
